home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-12-03 | 3.5 KB | 131 lines |
- /*
- A basic extension of the java.awt.Frame class
- */
-
- import java.awt.*;
-
- public class Animation extends Frame {
- void start_Clicked(Event event) {
-
-
- //{{CONNECTION
- // Start the animation
- {
- animator1.startAnimation();
- }
- //}}
- }
-
- void Stop_Clicked(Event event) {
-
-
- //{{CONNECTION
- // Stop the animation
- {
- animator1.stopAnimation();
- }
- //}}
- }
-
- void close_Clicked(Event event) {
-
-
- //{{CONNECTION
- // Hide the Frame
- hide();
- //}}
- }
-
-
- public Animation() {
-
- //{{INIT_CONTROLS
- setLayout(null);
- addNotify();
- resize(insets().left + insets().right + 426,insets().top + insets().bottom + 264);
- setBackground(new Color(16776960));
- animator1 = new symantec.itools.multimedia.Animator();
- animator1.reshape(insets().left + 37,insets().top + 10,352,87);
- add(animator1);
- animator1.setDelay(250);
- animator1.setNumLoops(1);
- animator1.setRepeatMode(true);
- try {
- java.net.URL[] tempURL = new java.net.URL[15];
- tempURL[0] = symantec.itools.net.RelativeURL.getURL("images/FN0.gif");
- tempURL[1] = symantec.itools.net.RelativeURL.getURL("images/FN1.gif");
- tempURL[2] = symantec.itools.net.RelativeURL.getURL("images/FN2.gif");
- tempURL[3] = symantec.itools.net.RelativeURL.getURL("images/FN3.gif");
- tempURL[4] = symantec.itools.net.RelativeURL.getURL("images/FN4.gif");
- tempURL[5] = symantec.itools.net.RelativeURL.getURL("images/FN5.gif");
- tempURL[6] = symantec.itools.net.RelativeURL.getURL("images/FN6.gif");
- tempURL[7] = symantec.itools.net.RelativeURL.getURL("images/FN7.gif");
- tempURL[8] = symantec.itools.net.RelativeURL.getURL("images/FN8.gif");
- tempURL[9] = symantec.itools.net.RelativeURL.getURL("images/FN9.gif");
- tempURL[10] = symantec.itools.net.RelativeURL.getURL("images/FN10.gif");
- tempURL[11] = symantec.itools.net.RelativeURL.getURL("images/FN11.gif");
- tempURL[12] = symantec.itools.net.RelativeURL.getURL("images/FN12.gif");
- tempURL[13] = symantec.itools.net.RelativeURL.getURL("images/FN13.gif");
- tempURL[14] = symantec.itools.net.RelativeURL.getURL("images/FN14.gif");
- animator1.setImageList(tempURL);
- } catch (java.net.MalformedURLException error) {
- }
- animator1.setClearFrame(false);
- animator1.setPreviewMode(true);
- Stop = new java.awt.Button("Stop the Animation");
- Stop.reshape(insets().left + 145,insets().top + 216,138,24);
- add(Stop);
- start = new java.awt.Button("Re-Start the Animation");
- start.reshape(insets().left + 287,insets().top + 216,138,24);
- add(start);
- close = new java.awt.Button("Close");
- close.reshape(insets().left + 3,insets().top + 216,138,24);
- add(close);
- setTitle("Untitled");
- //}}
-
- //{{INIT_MENUS
- //}}
- }
-
- public Animation(String title) {
- this();
- setTitle(title);
- }
-
- public synchronized void show() {
- move(50, 50);
- super.show();
- }
-
- public boolean handleEvent(Event event) {
- if (event.id == Event.WINDOW_DESTROY) {
- hide(); // hide the Frame
- return true;
- }
- if (event.target == close && event.id == Event.ACTION_EVENT) {
- close_Clicked(event);
- return true;
- }
- if (event.target == Stop && event.id == Event.ACTION_EVENT) {
- Stop_Clicked(event);
- return true;
- }
- if (event.target == start && event.id == Event.ACTION_EVENT) {
- start_Clicked(event);
- return true;
- }
- return super.handleEvent(event);
- }
-
- //{{DECLARE_CONTROLS
- symantec.itools.multimedia.Animator animator1;
- java.awt.Button Stop;
- java.awt.Button start;
- java.awt.Button close;
- //}}
-
- //{{DECLARE_MENUS
- //}}
- }
-